<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8" />
        <title>1_事件的绑定</title>
        <script type="text/javascript" src="../js/vue.js"></script>
    </head>
    <body>
        <div id="demo">
            <h2>学校名称: {{name}}</h2>
            <h2>学校地址: {{address}}</h2>
            <!-- <button v-on:click="welcome">点我欢迎新同学</button> -->
            <button @click="welcome">点我欢迎新同学</button>
        </div>
    </body>

    <script type="text/javascript">
        Vue.config.productionTip = false;

        new Vue({
            el: '#demo',
            data: {
                name: '尚硅谷',
                address: '宏福科技园'
            },
            methods: {
                welcome(){
                    alert('欢迎来学习!')
                }
            }
        })
        
    </script>
</html>